package day0723;

public class Test5 {

    public static void main(String[] args) {
        int[] a=new int[6];

        for (int i = 0; i < a.length; i++) {
            a[i]=(int)(Math.random()*100);
        }

        int sum=0;
        for (int i = 0; i < a.length; i++) {
            sum=sum+a[i];
        }
        System.out.println(sum);


    }














    /*public static void main(String[] args) {
        int[] a={2,6,3,8,4,3};
        int sum=0;
        //循环6次
        for (int i = 0; i < 6; i++) {
            sum = sum+ a[i];
        }
        System.out.println(sum);
    }*/
}
